#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <queue>
using namespace std;

int main() {
    long long n, k, sum = 0;
    priority_queue<int> pq;
    cin >> n >> k;
    while (n--)
    {
        int x;
        cin >> x;
        sum += x;
        if (x % 2 == 0) pq.push(x);
    }
    while (pq.size() && k--)
    {
        int y = pq.top();
        sum -= y / 2;
        pq.pop();
        if (y / 2 % 2 == 0) pq.push(y / 2);
    }
    cout << sum;
    return 0;
}